package com.pams.service;

import com.pams.context.BaseContext;
import com.pams.mapper.FileMapper;
import com.pams.pojo.entity.FileEN;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FileService {
    @Autowired
    private FileMapper fileMapper;
    public void add(FileEN theFile) {
        fileMapper.save(theFile);
    }

    public List<FileEN> getList() {
        String username = BaseContext.getCurrentUsername();
        return fileMapper.getList(username);
    }

    public void deleteOne(FileEN fileEN) {

        Long id = fileEN.getId();
        fileMapper.deleteOne(id);
    }
}
